#include <iostream>
#include <map>
#include <string>
#include <utility>

using namespace std;

int main()
{
	/*
	 * map特点：
	 * 1.
	 * */

	map<int,string> mp;

	mp.insert(pair<int, string>(1,"11111"));

	mp.insert(make_pair(2, "22222"));

	mp.insert(map<int, string>::value_type(3,"33333"));

	// 会覆盖，前三种会重复添加
	mp[4] = "44444";

	for (map<int,string>::iterator it = mp.begin(); it != mp.end(); it++) {
		cout << "key: " << it->first << ", value:" << it->second.c_str() << endl;	
	}

	map<int,string>::iterator it = mp.find(2);

	if(it != mp.end())
	{
		cout << "is find" << endl;
		cout << "key: " << it->first << ", value:" << it->second.c_str() << endl;	
	} 
	else 
	{
		cout << "not find" << endl;	
	}

	return 0;
}
